package com.itheima.tlais_web_management.mapper;

import com.itheima.tlais_web_management.pojo.Class;
import com.itheima.tlais_web_management.pojo.Dept;
import com.itheima.tlais_web_management.pojo.Emp;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ClassMapper {

    @Insert("insert into tlias.class(class_name, room_name, start_time, end_time, create_time, update_time, head_teacher) values (#{className},#{roomName},#{startTime},#{endTime},#{createTime},#{updateTime}, #{emp.id})")
    void insert(Class clas);


    void delete(@Param("ids") List<Integer> ids);


    List<Class> list(@Param("name") String name,@Param("startTime") LocalDate startTime,@Param("endTime") LocalDate endTime);

    @Select("select * from tlias.class")
    List<Class> listAllclass();

    void update(Class clas);

    @Select("select * from tlias.class where id = #{id}")
    List<Class> getbyclassid(@Param("id") Integer id);
}
